package com.softstao.guoyu.mvp.presenter.me;

import com.softstao.guoyu.model.me.PersonalInfo;
import com.softstao.guoyu.model.me.UserCondition;
import com.softstao.guoyu.mvp.interactor.me.UserInfoInteractor;
import com.softstao.guoyu.mvp.presenter.BasePresenter;
import com.softstao.guoyu.mvp.viewer.BaseViewer;
import com.softstao.guoyu.mvp.viewer.me.UpdateInfoViewer;
import com.softstao.guoyu.mvp.viewer.me.UserInfoViewer;

/**
 * Created by vaikus on 2017/6/13.
 */

public class UserInfoPresenter extends BasePresenter<BaseViewer,UserInfoInteractor> {
    public void getUserInfo(int agentId){
        interactor.getUserInfo(agentId,o -> ((UserInfoViewer)viewer).getUserInfo((PersonalInfo) o));
    }

    public void updateInfo(UserCondition condition){
        interactor.updateInfo(condition,o -> ((UpdateInfoViewer)viewer).updateResult((PersonalInfo) o));
    }
}
